package OnJava8.functional;

import java.util.concurrent.TimeUnit;

/**
 * @Auther DRevelation
 * @Date 2020-05-20 下午 13:54
 * @Desc
 */
public class RunnableMethodReference {
    public static void main(String[] args) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    TimeUnit.SECONDS.sleep(1);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("Annonymous");
            }
        }).start();

        new Thread(
            () -> System.out.println("lambda")
        ).start();

        new Thread(Go::go).start();
    }
}

class Go {
    static void go() {
        System.out.println("Go::go()");
    }
}